<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Index</title>
    <link rel="stylesheet" href="/static/css/index.css">
    <link rel="stylesheet" href="/static/css/base.css">
    <link rel="stylesheet" href="/static/css/swiper/css/style.css">
    <link rel="stylesheet" href="/static/css/swiper/css/swiper.min.css">
    <link rel="stylesheet" type="text/css" href="/static/css/book.css">
    <script type="text/javascript" src="/static/js/jquery.min.js"></script>
    <script type="text/javascript" src="/static/js/book.js"></script>
    <script type="text/javascript" src="/static/js/index.js"></script>

</head>

<style>

</style>
<script>

</script>
<body>
<div class="container">
    <div class="header">
        <div class="topBar" onmouseleave="closePersonContr(); closeSearch()">
            {{template "head-left.html"}}

            <div class="loginInfo">
                {{if .user}}
                    <div id="user" style="margin-right: 50px" onmouseenter="showPersonContr()">{{.user.Name}}</div>
                {{else}}
                    <a href="/login">登录</a>
                    <a href="/register" class="register">立即注册</a>
                {{end}}
                <div id="personShow">
                    {{if .user}}
                        {{if ne .user.Level "1"}}
                            <a href="/admin" style="width:80px;">管理员</a>
                        {{end}}
                        <a href="/exit" style="width: 80px; ">个人信息</a>
                        <a href="/exit" style="width: 80px;">退出</a>
                    {{end}}
                </div>


            </div>
        </div>
    </div>
    <div class="content" id="home">
        <!-- 轮播图 -->
        <div class="swiper-container">
            <div class="swiper-wrapper">
                <div class="swiper-slide swiper-lazy" data-background="/static/img/swiper/images/img1.jpg"
                     data-theme="gray">
                    <a href="javascript:"></a>
                </div>
                <div class="swiper-slide swiper-lazy" data-background="/static/img/swiper/images/img2.jpg"
                     data-theme="gray">
                    <a href="javascript:"></a>
                </div>
                <div class="swiper-slide swiper-lazy" data-background="/static/img/swiper/images/img3.jpg"
                     data-theme="white">
                    <a href="javascript:"></a>
                </div>
            </div>
            <div class="swiper-pagination"></div>
        </div>
    </div>
    <div class="content" id="baseKnowledge">
        <section id="knowledge" class="viewBlock">
            <div class="bookBox"
                 style="">
                <a class="lastBtn"><</a>
                <a class="nextBtn">></a>
                <div class="bookPage first">
                    <img src="{{ .homeImg }}" width="360" height="400"/>
                </div>
                {{range $book := .books}}
                    <div class="bookPage runPage">
                        <div class="bookWord">
                            <span>{{$book.Title}}</span>
                           <div>{{$book.Content}}</div>
                            <span class="pageNumber">{{$book.Id}}</span>
                        </div>
                        <img class="bookImg" src="{{$book.ImgId}}" width="360" height="400" style="transform:rotateY(180deg)"/>
                    </div>
                {{end}}
                <div class="bookPage last" style="z-index: -999">
                    <div class="bookWord">Loading
                        <span class="pageNumber">n</span>
                    </div>
                </div>
            </div>
        </section>
        <div style="text-align:center;">
        </div>
    </div>
    <div class="footer">
        @软工系统
    </div>
</div>

<!--轮播图开始-->
<script src="/static/js/swiper.min.js"></script>
<script src="/static/js/script.js"></script>
<!--轮播图结束-->
</body>

</html>